package org.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.sql.Timestamp;

/**
 * 评分实体类
 */
@Data
@Schema(description = "评分实体类")
public class Rating {
    @TableId(type = IdType.AUTO)
    @Schema(description = "自增主键")
    private Long id;
    
    @Schema(description = "用户ID")
    private Long userId;
    
    @Schema(description = "图书ID")
    private Long bookId;
    
    @Schema(description = "评分(1-5)")
    @NotNull(message = "评分不能为空")
    @Min(value = 1, message = "评分最小为1")
    @Max(value = 5, message = "评分最大为5")
    private Integer score;
    
    @Schema(description = "创建时间")
    private Timestamp createTime;
    
    @Schema(description = "更新时间")
    private Timestamp updateTime;
} 